package annotation;

import java.io.Console;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * Created by wangyg 
 * on 2017/3/23 16:53
 */

public class Test {

	public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException,
			InstantiationException, NoSuchMethodException, InvocationTargetException {
		Class<?> model = Class.forName("annotation.Module");
		Model inst = (Model) model.newInstance();
		//		Console console=System.console();
		//1.输出对象比较信息
		Utils.sout(model);

		//2.获取注解信息
		Utils.getAnnoMsg(model,App.class);
		//3.通过反射获取私有Method，调用
		Method print2 = model.getDeclaredMethod("print2");
		print2.setAccessible(true);
		print2.invoke(inst);


	}
}
